<?php
	/**
	* Request manager
	* @author: trungdt
	* @since: Oct 26, 2011
	* @version: 1.0
	* 
	*  
	* Change logs
	*/
	if (!defined('EXPONENT')) exit('');

	$config = $db->selectObject('requestmodule_config',"location_data='".serialize($loc)."'");

	// Administrator access restrict
	if (exponent_users_isLoggedIn() && $config)
	{
		$permission_approve=exponent_permissions_check(array("administrate", "approve"), $loc);
		$permission_add_calendar=exponent_permissions_check(array("administrate", "add_calendar"), $loc);

		exponent_flow_set(SYS_FLOW_PUBLIC,SYS_FLOW_ACTION);
		$template=new template("requestmodule","_request_manager",$loc);
		$template->register_permissions(array('administrate', "configure", "create", "edit", "delete", "approve", "add_calendar"),$loc);
		$template->assign("permission_approve", $permission_approve?1:0);
		$template->assign("permission_add_calendar", $permission_add_calendar?1:0);
		$template->output();
	}
	else
	{
		echo SITE_404_HTML;
	}
?>
